package com.chaucer.demo.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

/**
 * @Description TODO
 * @Author Chaucer
 * @Date 2021/9/3 17:50
 */
@Controller
@RequestMapping("config")
public class ConfigController {

    @NacosValue(value = "${inner.db.url}", autoRefreshed = true)
    private String useLocalCache;

    @RequestMapping(value = "/get", method = GET)
    @ResponseBody
    public String get() {
        System.out.println(useLocalCache);
        return useLocalCache;
    }


}